home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 16 / PC Actual CD 16.iso / cdactual / vb / AdvLabel1 / IncLabel.ctl (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-09-15  |  2.9 KB  |  93 lines

  1. VERSION 5.00
  2. Begin VB.UserControl IncLabel 
  3.    ClientHeight    =   1500
  4.    ClientLeft      =   0
  5.    ClientTop       =   0
  6.    ClientWidth     =   4410
  7.    ScaleHeight     =   1500
  8.    ScaleWidth      =   4410
  9.    ToolboxBitmap   =   "IncLabel.ctx":0000
  10.    Begin VB.Timer tmrActualiza 
  11.       Interval        =   100
  12.       Left            =   120
  13.       Top             =   120
  14.    End
  15.    Begin VB.Label lblTexto 
  16.       Height          =   735
  17.       Left            =   0
  18.       TabIndex        =   0
  19.       Top             =   0
  20.       Width           =   4215
  21.    End
  22. Attribute VB_Name = "IncLabel"
  23. Attribute VB_GlobalNameSpace = False
  24. Attribute VB_Creatable = True
  25. Attribute VB_PredeclaredId = False
  26. Attribute VB_Exposed = True
  27. '*****************************************************
  28. ' Curso de creaci
  29. n de controles en VB5 para PCActual
  30. ' Fichero:  IncLabel (IncLabel.ctl)
  31. ' Autor:    Lleonard del R
  32. o (intec)
  33. ' Fecha:    1/9/97
  34. ' Versi
  35. n:  1.0
  36. ' Descr:    Control "etiqueta incremental", en el que
  37. '           van apareciendo poco a poco los caracteres
  38. '           que forman el texto.
  39. '*****************************************************
  40. Option Explicit
  41. '*****************************************************
  42. ' Material privado
  43. '*****************************************************
  44. Private m_sCaption As String
  45. Private m_lIndice As Long
  46. '*****************************************************
  47. ' Funciones privadas de soporte
  48. '*****************************************************
  49. Private Sub ActualizarCaption()
  50.     tmrActualiza.Enabled = False
  51.     m_lIndice = 0
  52.     tmrActualiza.Enabled = True
  53. End Sub
  54. Private Sub tmrActualiza_Timer()
  55.     If m_lIndice = 0 Then lblTexto.Caption = ""
  56.     m_lIndice = m_lIndice + 1
  57.     lblTexto.Caption = lblTexto.Caption & Mid$(m_sCaption, m_lIndice, 1)
  58.     If m_lIndice > Len(m_sCaption) Then
  59.         tmrActualiza.Enabled = False
  60.     End If
  61. End Sub
  62. Private Sub UserControl_Resize()
  63.     lblTexto.Width = UserControl.ScaleWidth
  64.     lblTexto.Height = UserControl.ScaleHeight
  65. End Sub
  66. '*****************************************************
  67. ' Persistencia de propiedades
  68. '*****************************************************
  69. Private Sub UserControl_InitProperties()
  70.     m_sCaption = ""
  71.     ActualizarCaption
  72. End Sub
  73. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  74.     m_sCaption = PropBag.ReadProperty("Caption", "")
  75.     ActualizarCaption
  76. End Sub
  77. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  78.     Call PropBag.WriteProperty("Caption", m_sCaption, "")
  79. End Sub
  80. '*****************************************************
  81. ' Propiedades y m
  82. todos p
  83. blicos
  84. '*****************************************************
  85. Public Property Get Caption() As String
  86.     Caption = m_sCaption
  87. End Property
  88. Public Property Let Caption(ByVal Value As String)
  89.     m_sCaption = Value
  90.     PropertyChanged "Caption"
  91.     ActualizarCaption
  92. End Property
  93.